import React, { Component } from "react";

class Header extends Component {
  //todo 固定写法
  //todo static表示的是类的私有属性
  // static defaultProps = {
  //   num: 10,
  // };
  render() {
    const { num, count } = this.props;
    return (
      <div>
        这是头部 - {num} - {count}
      </div>
    );
  }
}
Header.defaultProps = {
  num: 10,
};

const Footer = ({ name }) => {
  return <div>这是底部 - {name}</div>;
};
Footer.defaultProps = {
  name: "juner",
};

class App extends Component {
  render() {
    return (
      <>
        <h2>props的默认值</h2>
        <Header count="4" />
        <Footer />
      </>
    );
  }
}

export default App;
